package com.hue.springbootemail.controller;

import com.hue.springbootemail.email.EmailUtils;
import com.hue.springbootstarter.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/email")
public class EmailController {
    @Autowired
    private EmailUtils emailUtils;
    @Autowired
    private UserServiceImpl userService;

    @RequestMapping("/send")
    public String send() {
        emailUtils.send("451737523@qq.com","测试邮件","测试邮件，无需回复");
        return "发送成功";
    }

    @RequestMapping("/user")
    public String user(){
        userService.hello();
        return "hello";
    }
}
